﻿<!--==Copyright comes here==-->
<Window x:Class="P2.Cuberry.Modules.Framework.User.UsersDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper"    
                
        Title="Peacequare Cuberry" Width="600" Height="480" 
            Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Background="{DynamicResource P2BackgroundBrush}"        
        >

    <Window.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.User;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.User;component/Images/cancel.png" />
            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.User;component/Images/printer2.png" />
            <Image x:Key="DeleteIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.User;component/Images/Remove.ico" />
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderUserDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />


        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Grid>
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn"  Margin="2,1,0,2" InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding UserSaveCommand}" Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding UserCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                <MenuItem x:Name="DeleteBtn" Margin="2,1,0,2" Header="{Translate DeleteBtn}" Command="{Binding UserDeleteCommand}" Icon="{StaticResource DeleteIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Icon="{StaticResource Printer2Icon}" Style="{StaticResource P2MenuItemStyle}"/>

                </Menu>
                <Menu Grid.Row="1" HorizontalAlignment="Right" x:Name="menuMainRight" Style="{StaticResource P2MenuStyle}" >
                    <MenuItem x:Name="HistoryBtn" Command="{Binding HistoryCommand}"  Style="{StaticResource P2MenuItemStyleHistory}"/>
                    <MenuItem x:Name="InfoBtn" Command="{Binding InfoCommand}"  Style="{StaticResource P2MenuItemStyleInfo}"/>
                </Menu>
            </Grid>
        </Border>
        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="167*"/>
                    <ColumnDefinition Width="397"/>

                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="55"/>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="60"/>
                </Grid.RowDefinitions>


                <Label  Grid.Row="1" Height="28" Margin="5,4,9,0" Name="UserIDL" VerticalAlignment="Top" Content="{Translate UserIDL}" />
                <TextBox  Grid.Row="1" Grid.Column="1" Margin="3,4,0,0" Name="UserID" Text="{Binding UserID , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" Height="23" VerticalAlignment="Top" 
                          IsReadOnly="{Binding IsUserIDReadOnly}" HorizontalAlignment="Left" Width="159" />

                <Label  Grid.Row="1" Margin="9,41,5,0" Name="UserGroupNamesL" Height="31.5" VerticalAlignment="Top" Content="{Translate UserGroupNamesL}"></Label>
                <ComboBox Grid.Row="1" Grid.Column="1" Margin="3,41,96,0" Name="UserGroupNames" ItemsSource="{Binding UserGroups}" SelectedValuePath="UserGroupID" DisplayMemberPath="UserGroupName" SelectedValue="{Binding Path=UserGroupID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2ComboBoxStyle}" Height="24" VerticalAlignment="Top"
                          IsReadOnly="{Binding IsReadOnly}"
                          />

                <Label  Grid.Row="1" Margin="8,73,2,0" Name="ActiveL" Content="{Translate ActiveL}" Height="28" VerticalAlignment="Top" />
                <CheckBox Grid.Row="1" Grid.Column="1" Margin="3,73,96,0" Name="Active" IsChecked="{Binding Active}"   Height="24" VerticalAlignment="Top" 
                          IsEnabled="{Binding IsEditable}"
                          />

                <Label  Grid.Row="1" Margin="9,123,5,0" Name="UserPWL" Content="{Translate UserPWL}" Height="28" VerticalAlignment="Top"/>
                <TextBox  Grid.Row="1" Grid.Column="1" 
                          IsReadOnly="{Binding IsReadOnly}"
                          Margin="3,123,103,0" Name="UserPW" Text="{Binding PW , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}"  Height="24" VerticalAlignment="Top" />

                <Label  Grid.Row="1" Margin="8,93,6,0" Name="UserEmployeeIDL" Content="{Translate UserEmployeeIDL}" Height="28" VerticalAlignment="Top" />
                <TextBox  Grid.Row="1" Grid.Column="1" 
                          IsReadOnly="{Binding IsReadOnly}"
                          Margin="3,93,103,0" Name="UserEmployeeID" Text="{Binding EmployeeID , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" Height="23" VerticalAlignment="Top" />

                <Label  Grid.Row="1" Margin="8,153,6,0" Name="UserDetailsL" Content="{Translate UserDetailsL}" Height="28" VerticalAlignment="Top" />
                <TextBox  Grid.Row="1" Grid.Column="1" 
                          IsReadOnly="{Binding IsReadOnly}"
                          Margin="3,153,103,0" Name="UserDetails" Text="{Binding Details , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" Height="23" VerticalAlignment="Top" />
                <Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="5,0,0,43" Name="NoteL" Content="{Translate NoteL}" VerticalAlignment="Bottom" Width="120" Height="23" />
                <TextBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,5" Name="Note" Height="43" HorizontalAlignment="Stretch"  VerticalAlignment="Bottom" VerticalScrollBarVisibility="Auto" Style="{StaticResource P2TextBoxStyle}"
                         Text="{Binding Note , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         IsReadOnly="{Binding IsReadOnly}"
                         />
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
